<?php

// Usage example with proxy server response time, bandwidth, country and type.
// Checking bandwidht means a little slower test (because we need to transfer a little bigger response to measure bandwidth).

$ip = '127.0.0.1';//put the proxy IP address here

$port = '8080';//put the proxy port here

$ch = curl_init('http://api.proxyipchecker.com/pchk.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,'ip='.$ip.'&port='.$port.'&bw=1');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

list($res_time, $speed, $country, $type) = explode(';', curl_exec($ch));

echo 'Response time: '.$res_time.' seconds -- Speed: '.$speed." B/s\n";
echo 'Country: '.$country.' -- Type: '.$type."\n";

?>
